<div class="layui-fluid" id="VIEW-list-table" lay-title="sku列表" lig-title="co-sku-title">
    <div class="layui-card">
        <div class="layui-card-header" lig-lang="label-searchTitle">筛选数据</div>
        <div class="layui-card-body">
            <div class="layui-row layui-col-space10 layui-form">
                <form class="layui-form" lay-filter="lig-sku-searchform">
                    <div class="layui-row">
                        <div class="layui-inline">
                            <label class="layui-form-label" lig-lang="co-customerCode">客户</label>
                            <div class="layui-inline">
                                <select name="customerCode">
                                    <option value=""></option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" lig-lang="sku-spbh">料号</label>
                            <div class="layui-inline">
                                <input type="text" class="layui-input" name="spbh" />
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" lig-lang="sku-spmc">商品名称</label>
                            <div class="layui-inline">
                                <input type="text" class="layui-input" name="spmc" />
                            </div>
                        </div>
                    </div>
                    <div class="layui-row" style="margin-top:10px;">
                        <div class="layui-inline">
                            <label class="layui-form-label" lig-lang="sku-splb">首饰品种</label>
                            <div class="layui-inline">
                                <select name="splb">
                                    <option value=""></option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" lig-lang="sku-fSh">审核状态</label>
                            <div class="layui-inline">
                                <select name="fSh">
                                    <option value=""></option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <div class="layui-row layui-col-space10">
                                <div class="layui-col-xs6">
                                    <div class="layui-btn layui-btn-sm layui-btn-fluid" lay-filter="lig-sku-search" lig-lang="btn-search">查询</div>
                                </div>
                                <div class="layui-col-xs6">
                                    <button type="reset" class="layui-btn layui-btn-sm layui-btn-primary" lig-lang="btn-reset">重置</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="layui-card">
        <div class="layui-card-body nepadmin-table-full">
            <table lay-filter="lig-sku-table"></table>
        </div>
    </div>
</div>
<script type="text/html" id="tpl-row-toolBar">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="lig-get" title="查看">查看</a>
</script>
<script type="text/html" id="tpl-sku-get">
    <form class="layui-form" lay-filter="lig-saveForm">
        <input type="hidden" name="skuId" value="{{d.skuId}}"/>
        <div class="layui-tab">
            <ul class="layui-tab-title">
                <li class="layui-this" lig-sku="sku-baseInfo">基本信息</li>
                <li lig-lang="sku-picInfo">图片及视频</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <div class="layui-form-item">
                        <label class="layui-form-label" lig-lang="sku-splb">首饰品种</label>
                        <div class="layui-input-block">
                            <select name="splb" lay-data="{{d.splb}}">
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" lig-lang="sku-spmc">商品名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="spmc" autocomplete="off"
                                   class="layui-input" value="{{d.spmc}}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" lig-lang="sku-pp">品牌</label>
                        <div class="layui-input-block">
                            <input type="text" name="pp" autocomplete="off"
                                   class="layui-input" value="{{d.pp}}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" lig-lang="sku-cz">贵金属材质</label>
                        <div class="layui-input-block">
                            <input type="text" name="cz" autocomplete="off"
                                   class="layui-input" value="{{d.cz}}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" lig-lang="sku-zl">质量</label>
                        <div class="layui-input-inline">
                            <input type="text" name="zl" autocomplete="off"
                                   class="layui-input" value="{{d.zl}}">
                        </div>
                        <div class="layui-form-mid layui-word-aux">g</div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" lig-lang="sku-zldw">纯度</label>
                        <div class="layui-input-block">
                            <input type="text" name="purity" autocomplete="off"
                                   class="layui-input" value="{{d.purity}}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" lig-lang="sku-zldw">宝石名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="gemName" autocomplete="off"
                                   class="layui-input" value="{{d.gemName}}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" lig-lang="sku-zldw">宝石质量</label>
                        <div class="layui-input-block">
                            <input type="text" name="gemQuality" autocomplete="off"
                                   class="layui-input" value="{{d.gemQuality}}">
                        </div>
                    </div>
                </div>
                <div class="layui-tab-item">
                    <div class="layui-upload">
                        <div class="layui-upload-list">
                            <table class="layui-table">
                                <thead>
                                    <tr>
                                        <th lig-lang="file-fileName">文件名</th>
                                        <th lig-lang="file-fileSize">大小</th>
                                    </tr>
                                </thead>
                                <tbody lay-filter="lig-fileList">
                                {{#
                                    layui.each(d.fileList, function(i, it) {
                                }}
                                <tr>
                                    <td><a href="/platform/file/download?url={{it.fileUrl}}&&name={{it.fileName}}" target="_blank">{{it.fileName}}</a></td>
                                    <td>{{it.fileSize}}kb</td>
                                </tr>
                                {{#
                                    });
                                }}
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</script>
<script type="text/html" id="tpl-zl">
    {{#
    var zl = '';
    if (d.zl != '') {
    zl = d.zl + 'g';
    }
    }}
    <span>{{zl}}</span>
</script>
<script>
    layui.use(['form', 'jquery','lig'], function (form, $, lig) {
        form.render();

        lig.selectCustomerList('[lay-filter="lig-sku-searchform"] select[name="customerCode"]');
        lig.loadSelectDict('sku_splb', '[lay-filter="lig-sku-searchform"] select[name="splb"]');
        lig.loadSelectDict('sku_fSh', '[lay-filter="lig-sku-searchform"] select[name="fSh');

        var dataTable = lig.table({
            elem: '[lay-filter="lig-sku-table"]',
            url: 'pd/co/sku/page',
            cols: [[
                { title: '<span lig-lang="label-opt">操作</span>', toolbar: '#tpl-row-toolBar', align: 'left', width: 70},
                { title: '<span lig-lang="sku-spbh">料号</span>', field: 'spbh', minWidth: 200 },
                { title: '<span lig-lang="sku-splb">首饰品种</span>', field: 'splbmc', minWidth: 100 },
                { title: '<span lig-lang="sku-spmc">商品名称</span>', field: 'spmc', minWidth: 100 },
                { title: '<span lig-lang="sku-pp">品牌</span>', field: 'pp', minWidth: 100 },
                { title: '<span lig-lang="sku-cz">贵金属材质</span>', field: 'czName', minWidth: 100 },
                { title: '<span lig-lang="sku-zl">质量</span>', field: 'zl', minWidth: 100, templet: '#tpl-zl' },
                { title: '<span lig-lang="sku-purity">纯度</span>', field: 'purityName', minWidth: 100 },
                { title: '<span lig-lang="sku-gemName">宝石名称</span>', field: 'gemName', minWidth: 100 },
                { title: '<span lig-lang="sku-gemQuality">宝石质量</span>', field: 'gemQuality', minWidth: 100 }
            ]]
        },{
            entity: 'sku',
            primaryField: 'skuId',
            getContent: $('#tpl-sku-get').html(),
            getHeight:'70%',
            getTitle: '<span lig-lang="sku-getSku">查看sku</span>',
            onGet: function() {
              return true;
            },
            onGetOpened: function() {
                lig.loadSelectDict('sku_splb', '[lay-filter="lig-saveForm"] select[name="splb"]');
            },
            getUrl: 'pd/co/sku/{skuId}'
        });
    })
</script>